package com.wander.io;

import java.io.*;

public class DataInputStreamExample {
    public static void main(String[] args) {
        try {
            File file = new File("D:\\code\\test.txt");
            FileOutputStream fos = new FileOutputStream(file);
            DataOutputStream dos = new DataOutputStream(fos);
            dos.writeUTF("Hello World");
            dos.flush();
            dos.close();
            fos.close();
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
